#include "State.h"
#include "AITypes.h"
#include <ProgramCommon/WzDataType.h>

class Monster;

class WanderState : public State
{
public:
	WanderState();
	~WanderState();

	virtual VOID			Init();
	virtual VOID			OnEnter( LPARAM param1, LPARAM param2, LPARAM param3 );
	virtual VOID			OnExit();
	virtual VOID			OnUpdate( DWORD dwDeltaTick );

	virtual VOID			SetNPC( NPC *pNPC ) { m_pMonster = (Monster*)pNPC; State::SetNPC(pNPC); }

protected:
	virtual VOID			OnMsgAttacked( AI_MSG *pMsg );
	virtual VOID			OnMsgLetsGo( AI_MSG *pMsg );
	virtual VOID			OnMsgEnemyFound( AI_MSG *pMsg );

private:
	BOOL					DoWander();
	BOOL					DoWanderAsFollower();
	BOOL					DoWanderPatrol();

	BOOL					m_bDestSelected;
	BOOL					m_bTouchedSomething;
	WzVector				m_wvRotatedVector;
	util::Timer				*m_pSearchTimer;

	Monster*				m_pMonster;
};
